{dede:config.pagesize value='30'/}
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
		<title>友情链接管理</title>
		<link rel="stylesheet" href="/static/web/css/font-awesome.min.css">
		<link rel="stylesheet" href="/static/web/css/bootstrap.min.css">
		<link rel="stylesheet" href="/static/web/css/admin.css">
		<script src="/static/web/js/jquery.min.js"></script>
		<script src="/static/web/js/bootstrap.min.js"></script>
		<script src="/static/web/js/admin.main.js"></script>
	</head>
	<body>
		<div class="container-fluid">
			<ol class="breadcrumb">
				<li class="breadcrumb-item"><a href="index_body.php">后台面板</a></li>
				<li class="breadcrumb-item active">友情链接管理</li>
			</ol>
			<div class="card shadow-sm mb-3">
				<div class="card-body">
					<form action="friendlink_main.php" name="form1" method="get">
						<input type="text" name="keyword" id="keyword" placeholder="请输入关键词" value="<?php echo $keyword;?>" class="admin-input-lg mr-2">
						<select name="ischeck" id="ischeck" class="admin-input-sm">
							<?php
							foreach($selCheckArr as $k=>$v)
							{
								if ($k==$ischeck) echo "<option value='$k' selected>$v</option>";
								else echo "<option value='$k'>$v</option>";
							}
							?>
						</select>
						<button type="submit"class="btn btn-success btn-sm">搜索</button>
						<a href="friendlink_add.php" class="btn btn-success btn-sm">添加链接</a>
						<a href="friendlink_type.php" class="btn btn-success btn-sm">网站类型管理</a>
						<a href="<?php echo $cfg_phpurl;?>/flink.php?dopost=add" target="_blank" class="btn btn-success btn-sm">申请链接</a>
						<a href="{dede:global name=' cfg_phpurl'/}/flink.php" target="_blank" class="btn btn-success btn-sm">链接预览</a>
					</form>
				</div>
			</div>
			<div class="card shadow-sm">
				<div class="card-header">友情链接管理</div>
				<div class="card-body">
					<form name="form1" method="post" action="friendlink_edit.php">
						<input type="hidden" name="dopost" value="delall">
						<input type="hidden" name="allid">
						<div class="table-responsive">
							<table class="table table-borderless table-hover">
								<thead>
									<tr>
										<td scope="col">选择</td>
										<td scope="col">名称</td>
										<td scope="col">地址</td>
										<td scope="col">图标</td>
										<td scope="col">邮箱</td>
										<td scope="col">时间</td>
										<td scope="col">状态</td>
										<td scope="col">顺序</td>
										<td scope="col">操作</td>
									</tr>
								</thead>
								<tbody>
									{dede:datalist}
									<tr>
										<td><input type='checkbox' name='aids' value='{dede:field.id/}'></td>
										<td>{dede:field.webname function='dede_htmlspecialchars(@me)'/}</td>
										<td>{dede:field.url/}</td>
										<td>{dede:field.logo function="GetPic(@me)"/}</td>
										<td>{dede:field.email/}</td>
										<td>{dede:field.dtime function="MyDate('Y-m-d',@me)"/}</td>
										<td>{dede:field.ischeck function="GetSta(@me)"/}</td>
										<td>{dede:field.sortrank/}</td>
										<td>
											<a href="friendlink_edit.php?id={dede:field.id/}&dopost=getedit" class="btn btn-light btn-sm"><i class="fa fa-pencil-square" title="修改"></i></a>
											<a href="friendlink_edit.php?id={dede:field.id/}&dopost=delete" class="btn btn-danger btn-sm"><i class="fa fa-trash" title="删除"></i></a>
										</td>
									</tr>
									{/dede:datalist}
									<tr>
										<td colspan="9">
											<a href="javascript:Sel('all');" class="btn btn-success btn-sm">全选</a>
											<a href="javascript:Sel('none');" class="btn btn-success btn-sm">取消</a>
											<a href="javascript:checkSubmit();" class="btn btn-success btn-sm">批量删除</a>
										</td>
									</tr>
								</tbody>
							</table>
						</div>
					</form>
					{dede:pagelist listsize='6'/}
				</div>
			</div>
		</div>
		<script>
			function Sel(stype) {
				for (var i = 0; i < document.getElementsByName('aids').length; i++) {
					if (stype == 'all') document.getElementsByName('aids')[i].checked = true;
					else document.getElementsByName('aids')[i].checked = false;
				}
			}
			function checkSubmit() {
				var str = '';
				for (var i = 0; i < document.getElementsByName('aids').length; i++) {
					if (document.getElementsByName('aids')[i].checked) {
						if (str == "") str += document.getElementsByName('aids')[i].value;
						else str += ',' + document.getElementsByName('aids')[i].value;
					}
				}
				if (str == "") {
					ShowMsg('您没选择任何文档');
					return false;
				} else {
					location = "friendlink_edit.php?aids=" + str + "&dopost=delall";
				}
			}
		</script>
	</body>
</html>